<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>过渡动画效果2</title>
    <style>
        *{
            margin:0;
            padding: 0;
        }
        .box{
            width: 508px;
            height: 107px;
            border: 1px solid #000;
            margin: 40px auto;
        }
        .box ul{
            list-style: none;
        }
        .box ul li{
            float:left;
            width: 107px;
            height: 107px;
            margin-right: 20px;
            position: relative;
        }
        /* before行内元素必须转化为块级元素 */
        .box ul li:before{
            content: '';
            display: block;
            width:107px;
            height: 107px;
            transition:transform 1s ease 0s;
        }
        .box ul li:nth-child(1)::before{
            background-image:url(./xiaomu_hospital_project/images/a_1.png);
        }
        .box ul li:nth-child(2)::before{
            background-image:url(./xiaomu_hospital_project/images/a_2.png);
        }
        .box ul li:nth-child(3)::before{
            background-image:url(./xiaomu_hospital_project/images/a_3.png);
        }
        .box ul li:nth-child(4)::before{
            background-image:url(./xiaomu_hospital_project/images/a_4.png);
        }
        .box ul li img{
            position:absolute;
            width: 60px;
            height: 60px;
            top: 50%;
            left: 50%;
            margin-left: -30px;
            margin-top: -30px;
        }
        .box ul li:hover::before{
            transform:rotate(360deg);
        }
    </style>
</head>
<body>
    <div class="box">
        <ul>
            <li>
                <img src="./xiaomu_hospital_project/images/icon1.svg" alt="">
            </li>
            <li>
                <img src="./xiaomu_hospital_project/images/icon2.svg" alt="">
            </li>
            <li>
                <img src="./xiaomu_hospital_project/images/icon3.svg" alt="">
            </li>
            <li>
                <img src="./xiaomu_hospital_project/images/icon4.svg" alt="">
            </li>
        </ul>
    </div>
</body>
</html>